#include <stdio.h>

int main(void)
{
    int nums[]={1,2,3,4,5};
    double nums2[5]={0};
    //定义普通指针，默认指向数组首元素
    int *ptr1=&nums[0];
    //定义数组指针，指向整个数组
    int (*ptr2)[5]=&nums;
    //printf("nums:%p\n",nums);
    //printf("&nums:%p\n",&nums);
    printf("ptr1:%p\n",ptr1);
    printf("ptr2:%p\n",ptr2);
    printf("nums2:%p\n",nums2);
    ptr1++;
    //ptr2++;

    printf("ptr1:%p\n",ptr1);//数组第二元素的地址
    printf("ptr2:%p\n",ptr2);//nums数组后面的元素的地址

    //通过数组指针遍历数组
    for (int i = 0; i < 5; i++)
    {
        printf("%d ",(*ptr2)[i]);
    }
    
    return 0;
}